
package pack0910;

// 三目运算符
public class DemoF {
    public static void main(String[] args) {
        int num = (int) (Math.random() * 100 + 1);
        System.out.println("num:" + num);
        String str = (num % 2 == 0) ? num + "是偶数" : num + "是奇数";
        System.out.println(str);
    }
}